home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir27 / calctool.zip / MAKEFILE < prev    next >
Text File  |  1994-02-09  |  11KB  |  288 lines

  1. #
  2. #  Makefile for calctool, a calculator program.
  3. #
  4. #  @(#)Makefile 1.16 89/12/21
  5. #
  6. #  Copyright (c) Rich Burridge.
  7. #         Sun Microsystems, Australia - All rights reserved.
  8. #
  9. #  Permission is given to distribute these sources, as long as the
  10. #  copyright messages are not removed, and no monies are exchanged.
  11. #
  12. #  No responsibility is taken for any errors inherent either in the comments
  13. #  or the code of this program, but if reported to me then an attempt will
  14. #  be made to fix them.
  15. #
  16. #======================================================================
  17. #
  18. #  There are various small changes needed when compiling calctool on
  19. #  different systems. These have been isolated here, and should
  20. #  be uncommented if needed.
  21. #
  22. #======================================================================
  23. #
  24. #  Calctool uses an helpfile to supply online help for each key.
  25. #  By default this file is called "calctool.help", and is looked
  26. #  for in every directory on the users search path. You can also
  27. #  override it's location and name at runtime with the -h option.
  28. #  It can also be specified here by uncommenting the following
  29. #  macro definition and setting appropriately.
  30. #
  31. LIBDIR        = \"d\:/contrib/lib/calctool\"
  32. HELPNAME    = -DHELPNAME=\"$(LIBDIR)/calctool.hel\"
  33. #-----------------------------------------------------------------------
  34. #  An attempt is now made at using a portable math library. You should
  35. #  carefully setup the following three definitions.
  36. #
  37. #  One of the things this is not the same on all machines is the
  38. #  floating point format. If your machine does *not* use IEEE floating
  39. #  point format, then the following definition needs to be uncommented.
  40. #
  41. #NOIEEE        = -DIEEE
  42. NOIEEE        =
  43. #-----------------------------------------------------------------------
  44. #  Not all machines have the index() string library function. If you
  45. #  don't have this function then you should uncomment the NOINDEX
  46. #  definition below.
  47. #
  48. #NOINDEX    = -DNOINDEX
  49. NOINDEX     =
  50. #-----------------------------------------------------------------------
  51. #  If you are compiling the MGR version, then the following three
  52. #  definitions should be uncommented.
  53. #
  54. #MGRHOME    = /usr/mgr
  55. #MGRPARAM    = -DMGRHOME=\"$(MGRHOME)\"
  56. MGRPARAM    =
  57. #MGRINCDIR     = -I$(MGRHOME)/include
  58. MGRINCDIR    =
  59. #-----------------------------------------------------------------------
  60. #  If you are compiling the NeWS version, then the following definition
  61. #  should be uncommented and set to the default location for the calctool
  62. #  PostScript file, which is downloaded to the NeWS server.
  63. #
  64. #NEWSFILE     = -DNEWSFILE=\"$(LIBDIR)/calctool.ps\"
  65. NEWSFILE    =
  66. #-----------------------------------------------------------------------
  67. #  Calctool loads a run control file when it starts. By default
  68. #  this file is called ".calctoolrc", and is taken from the users
  69. #  home directory. If there is a similar file in the current directory,
  70. #  then these values override the default ones. Its name and location
  71. #  can also be specified here by uncommenting the following macro
  72. #  definition and setting appropriately.
  73. #
  74. #RCNAME      = -DRCNAME=\".calctoolrc\"
  75. RCNAME      = -DRCNAME=\"xcalctoo.res\"
  76. #RCNAME        =
  77. #-----------------------------------------------------------------------
  78. #  If you not running under a BSD4.3 derived system, the parameters
  79. #  to the select call are different, and this definition should be
  80. #  uncommented. You need to uncomment this for SunOS v3.x.
  81. #
  82. #SELTYPE    = -DNO_4.3SELECT
  83. SELTYPE        =
  84. #-----------------------------------------------------------------------
  85. #  Note that with SunOS v4.x it is possible to create a shared library
  86. #  for the calctool routines. If you wish to do this, then you should
  87. #  uncomment the other three definitions below, commented out the initial
  88. #  two.
  89. #
  90. LIBNAME     = libcalctool.a
  91. CALCLIB     = $(LIBNAME)
  92. #
  93. # Shared library definitions. Uncomment if required.
  94. #LIBNAME     = libcalctool.so.1.1
  95. #CALCLIB     = -L. -lcalctool
  96. #SHLIB         = -pic
  97. SHLIB        =
  98. #-----------------------------------------------------------------------
  99. #  If you are not running under a BSD4.3 derived system, then the
  100. #  second parameter to a select call is a pointer to an integer function,
  101. #  and this definition needs to be uncommented. You need to uncomment this
  102. #  for SunOS v3.x.
  103. #
  104. #SIGRET     = -DNO_4.3SIGNAL
  105. SIGRET           =
  106. #--------------------------------------------------------------------------
  107. #  Calctool endevours to provide a numeric keypad using the right function
  108. #  keypad. The Sun3 keyboard has a different pad setup to the Sun4 keyboard.
  109. #  If you wish to use these function keys with a Sun4 keyboard, then you
  110. #  need to uncomment the following definition.
  111. #
  112. # SUN4_KEYBOARD  = -DSUN4_KEYBOARD
  113. SUN4_KEYBOARD  =
  114. #-------------------------------------------------------------------------
  115. #  If you are running SunOS v3.x, then pr_ttext doesn't exist, and
  116. #  you must uncomment this definition.
  117. #
  118. #TTEXT        = -DNO_PR_TTEXT
  119. TTEXT           =
  120. #-------------------------------------------------------------------------
  121. #  If you are compiling the X11 version and the X11 include and
  122. #  library files are not in a standard place, then the following
  123. #  two lines should be uncommented, and set appropriately.
  124. #
  125. X11INCDIR = -Id:/djgpp/include/X11
  126. # X11LIBDIR        = -L/djgpp/lib/X11
  127. # X11LIBDIR = -L/djgpp/lib
  128. X11LIBDIR = -Ld:/djgpp/lib
  129. #-------------------------------------------------------------------------
  130. #  If you are compiling the XView version, then the following two lines
  131. #  should be uncommented.
  132. #
  133. # XVIEWINCDIR       = -I$(OPENWINHOME)/include
  134. XVIEWINCDIR     =
  135. # XVIEWLIBDIR       = -L$(OPENWINHOME)/lib
  136. #
  137. #=========================================================================
  138. #
  139. #  Default locations where calctool files will be installed.
  140. #  You might wish to alter these values.
  141. #
  142. BINDIR        = d:/contrib/bin
  143. LIBDIR        = d:/contrib/lib
  144. MANDIR        = d:/contrib/man/man$(MANSECT)
  145. MANSECT     = 1
  146. #
  147. #  Compilation flags and standard macro definitions.
  148. #
  149. CFLAGS        = -O6 $(HELPNAME) $(NEWSFILE) $(NOIEEE) $(NOINDEX) $(RCNAME) \
  150.              $(SELTYPE) $(SHLIB) $(SIGRET) $(SUN4_KEYBOARD) \
  151.              $(TTEXT) $(MGRPARAM) $(MGRINCDIR) $(X11INCDIR) \
  152.              $(XVIEWINCDIR) 
  153. #
  154. #=========================================================================
  155.  
  156. BINARIES    = mgr_calctool ps_calctool sv_calctool \
  157.           tty_calctool xcalctool xv_calctool
  158.  
  159. CC        = gcc
  160. XE        = .exe
  161.  
  162. LIBSRCS     = graphics.c display.c functions.c get.c
  163. LIBOBJS     = graphics.o display.o functions.o get.o
  164. STDSRCS     = calctool.c mathlib.c
  165. STDOBJS     = calctool.o mathlib.o
  166. OBJS        = $(STDOBJS) $(LIBNAME)
  167.  
  168. GSRCS        = mgr.c news.c sunview.c tty.c x11.c xview.c
  169. HDRS        = calctool.h color.h extern.h mathlib.h
  170. IMAGES        = calctool.icon calctool.col help.cursor
  171. OTHERS        = Makefile README TODO calctool.hel calctool.1 \
  172.           CHANGES calctool.ps patchlevel.h .calctoolrc \
  173.           Imakefile.main Imakefile.lib
  174.  
  175. SFILES1     = $(STDSRCS)
  176. SFILES2     = $(LIBSRCS)
  177. SFILES3     = $(GSRCS)
  178. SFILES4     = $(HDRS) $(IMAGES)
  179. SFILES5     = $(OTHERS)
  180.  
  181. MGRLIBS     = $(CALCLIB) $(MGRHOME)/lib/libmgr.a -lm
  182. NEWSLIBS    = $(CALCLIB) $$OPENWINHOME/lib/libcps.a -lm
  183. SVIEWLIBS    = $(CALCLIB) -lsuntool -lsunwindow -lpixrect -lm
  184. TTYLIBS     = $(CALCLIB) -ltermcap -lm
  185. # X11LIBS      = $(CALCLIB) -lx -lm
  186. X11LIBS     = $(CALCLIB) -lxt -lxmu -lxext -lx -lsys -lm
  187. XVIEWLIBS    = $(CALCLIB) -lxview -lolgx -lX11 -lm
  188.  
  189. .PRECIOUS:    $(LIBNAME)
  190.  
  191. help:
  192.         @echo
  193.         @echo "You need to specify one of the following options:"
  194.         @echo
  195.         @echo "  make mgr     - to make the MGR version."
  196.         @echo "  make news     - to make the NeWS version."
  197.         @echo "  make sunview     - to make the SunView version."
  198.         @echo "  make tty     - to make the dumb tty version."
  199.         @echo "  make x11     - to make the X11 version."
  200.         @echo "  make xview     - to make the XView version."
  201.         @echo
  202.         @echo "This should be followed by:"
  203.         @echo
  204.         @echo "  make install"
  205.         @echo "  make clean"
  206.         @echo
  207.  
  208. all:        $(BINARIES)
  209.  
  210. mgr:        $(OBJS) mgr.o
  211.         $(CC) -o mgr_calctool $(CFLAGS) $(STDOBJS) mgr.o $(MGRLIBS)
  212.         -cp mgr_calctool calctool
  213.  
  214. news:        $(OBJS) news.o
  215.         $(CC) -o ps_calctool $(CFLAGS) $(STDOBJS) news.o $(NEWSLIBS)
  216.         -cp ps_calctool calctool
  217.  
  218. sunview:    $(OBJS) sunview.o
  219.         $(CC) -o sv_calctool $(CFLAGS) $(STDOBJS) sunview.o $(SVIEWLIBS)
  220.         -cp sv_calctool calctool
  221.  
  222. tty:        $(OBJS) tty.o
  223.         $(CC) -o tty_calctool $(CFLAGS) $(STDOBJS) tty.o $(TTYLIBS)
  224.         -cp tty_calctool calctool
  225.  
  226. x11:        $(OBJS) x11.o
  227.         $(CC) -o xcalctool $(X11LIBDIR) $(CFLAGS) $(STDOBJS) x11.o \
  228.                 $(X11LIBS)
  229.         strip xcalctool
  230.         coff2exe xcalctool
  231.         -cp xcalctool calctool
  232.  
  233. xview:        $(OBJS) xview.o
  234.         $(CC) -o xv_calctool $(XVIEWLIBDIR) $(CFLAGS) $(STDOBJS) \
  235.                 xview.o $(XVIEWLIBS)
  236.         -cp xv_calctool calctool
  237.  
  238. libcalctool.a:    $(LIBOBJS)
  239.         ar rv $@ $?
  240.         ranlib $@
  241.          
  242. #  These are the library creation rules for making the shared calctool
  243. #  library (available with SunOS v4.x).
  244.  
  245. libcalctool.so.1.1:    $(LIBOBJS)
  246.             ld -o libcalctool.so.1.1 -assert pure-text $?
  247.  
  248. install:
  249.         install -c -m 644 $(LIBNAME) $(LIBDIR)
  250.         install -s -m 751 xcalctool$(XE) $(BINDIR)
  251.         install -c -m 644 calctool.help $(LIBDIR)
  252.         install -c -m 644 calctool.ps $(LIBDIR)
  253.         install -c -m 644 calctool.1 $(MANDIR)/calctool.$(MANSECT)
  254.  
  255. clean:;     grm -f *.o archive.* *~ *.a $(BINARIES) core
  256.  
  257. lint:;        lint $(CFLAGS) $(STDSRCS) $(LIBSRCS) tty.c $(TTYLIBS)
  258.         lint $(CFLAGS) $(STDSRCS) $(LIBSRCS) sunview.c $(SVIEWLIBS)
  259.         lint $(CFLAGS) $(STDSRCS) $(LIBSRCS) xview.c $(XVIEWLIBS)
  260.         lint $(CFLAGS) $(STDSRCS) $(LIBSRCS) x11.c $(X11LIBS)
  261.         lint $(CFLAGS) $(STDSRCS) $(LIBSRCS) news.c $(NEWSLIBS)
  262.         lint $(CFLAGS) $(STDSRCS) $(LIBSRCS) mgr.c $(MGRLIBS)
  263.  
  264. shar:;        shar.script $(SFILES1) > archive.1
  265.         shar.script $(SFILES2) > archive.2
  266.         shar.script $(SFILES3) > archive.3
  267.         shar.script $(SFILES4) > archive.4
  268.         shar.script $(SFILES5) > archive.5
  269.  
  270. create:     SCCS
  271.         -sccs create $(STDSRCS) $(GSRCS) $(HDRS) $(IMAGES) $(OTHERS)
  272. SCCS:
  273.         -mkdir SCCS
  274.         chmod 755 SCCS
  275.  
  276. calctool.o:    calctool.c patchlevel.h color.h calctool.h
  277. display.o:    display.c calctool.h color.h extern.h
  278. functions.o:    functions.c calctool.h color.h extern.h
  279. get.o:        get.c patchlevel.h calctool.h color.h extern.h
  280. graphics.o:    graphics.c calctool.h color.h extern.h
  281. mathlib.o:    mathlib.c mathlib.h calctool.h
  282. mgr.o:        mgr.c calctool.h color.h extern.h
  283. news.o:     news.c calctool.h color.h extern.h
  284. sunview.o:    sunview.c calctool.h color.h extern.h
  285. tty.o:        tty.c calctool.h color.h extern.h
  286. x11.o:        x11.c calctool.h color.h extern.h
  287. xview.o:    xview.c calctool.h color.h extern.h help.cursor calctool.icon calctool.color.icon
  288.